//首页
var dbserver = require('../dao/dbserver');

//获取好友列表
exports.getFriend = function(req,res){
  let {uid,state} = req.body;
  dbserver.getUsers(uid,state,res);
}

//获取好友最后一条消息
exports.getOneMsg = function(req,res){
  let data = req.body;
  dbserver.getOneMsg(data,res);
}

//汇总未读消息数
exports.unreadMsg = function(req,res){
  let data = req.body;
  dbserver.unreadMsg(data,res);
}

//修改一对一消息状态，置为已读
exports.updateMsg = function(req,res){
  let data = req.body;
  dbserver.updateMsg(data,res);
}

//获取群列表,未读消息数
exports.getGroup = function(req,res){
  let {uid} = req.body;
  dbserver.getGroup(uid,res);
}

//获取群最后一条消息
exports.getOneGroupMsg = function(req,res){
  let {gid} = req.body;
  dbserver.getOneGroupMsg(gid,res);
}

//修改群消息状态，置为已读
exports.updateGroupMsg = function(req,res){
  let data = req.body;
  dbserver.updateGroupMsg(data,res);
}
